#ifndef AUDIOINFOINPUT_H
#define AUDIOINFOINPUT_H

#include "opensl_engine.h"

#include <QIODevice>

#include <Task_Base/CriticalSection.h>

class Receive_handler;
class AudioInfoInPut /*: public QIODevice*/
{
public:
    AudioInfoInPut(OpenSl_Engine *,Receive_handler*);
    ~AudioInfoInPut();
public:
    void start();
    void stop();
protected:
    static void bqRecorderCallback(SLAndroidSimpleBufferQueueItf bq, void *context);
    void RecorderCallback(SLAndroidSimpleBufferQueueItf bq);
private:
    short recorderBuffer[1024];  // 其实是4000字节

    CCriticalSection oCriSection;

    std::string  m_InPut_buf;

    Receive_handler* m_handler;

    SLObjectItf recorderObject;

    SLRecordItf recorderRecord;

    SLAndroidSimpleBufferQueueItf recorderBufferQueue;

    OpenSl_Engine *m_pOpenSlEngine;
};

#endif // AUDIOINFOINPUT_H
